#-------------------------------------------------
#
# Project created by QtCreator 2024-08-27T09:16:34
#
#-------------------------------------------------

QT       -= core gui

TARGET = XImage
TEMPLATE = lib

DEFINES += XIMAGE_LIBRARY

# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

win32 {
    CONFIG += staticlib
}

# For macOS: Dynamic library
macx {
    CONFIG += shared
}

SOURCES += \
    tif_xfile.cpp \
    ximabmp.cpp \
    ximadsp.cpp \
    ximaenc.cpp \
    ximaexif.cpp \
    ximage.cpp \
    ximagif.cpp \
    ximahist.cpp \
    ximaico.cpp \
    ximainfo.cpp \
    ximaint.cpp \
    ximajas.cpp \
    ximajbg.cpp \
    ximajpg.cpp \
    ximalpha.cpp \
    ximalyr.cpp \
    ximamng.cpp \
    ximapal.cpp \
    ximapcx.cpp \
    ximapng.cpp \
    ximapsd.cpp \
    ximaraw.cpp \
    ximasel.cpp \
    ximaska.cpp \
    ximatga.cpp \
    ximath.cpp \
    ximatif.cpp \
    ximatran.cpp \
    ximawbmp.cpp \
    ximawmf.cpp \
    ximawnd.cpp \
    xmemfile.cpp

HEADERS += \
    stdint.h \
    xfile.h \
    ximabmp.h \
    ximacfg.h \
    ximadef.h \
    ximage.h \
    ximagif.h \
    ximaico.h \
    ximaiter.h \
    ximajas.h \
    ximajbg.h \
    ximajpg.h \
    ximamng.h \
    ximapcx.h \
    ximapng.h \
    ximapsd.h \
    ximaraw.h \
    ximaska.h \
    ximatga.h \
    ximath.h \
    ximatif.h \
    ximawbmp.h \
    ximawmf.h \
    xiofile.h \
    xmemfile.h \
    typedef.h \
    basic_func.hpp

unix {
    target.path = /usr/lib
    INSTALLS += target
}

greaterThan(QT_MAJOR_VERSION,4){
        TARGET_ARCH=$${QT_ARCH}
}else{
        TARGET_ARCH=$${QMAKE_HOST.arch}
}

win32 {
contains(TARGET_ARCH, x86_64){
   message('---------- win64 ----------')
    DESTDIR = $$PWD/../Bin/Bin-win64

}else{
   message('---------- win32 ----------')
    DESTDIR = $$PWD/../Bin/Bin-win32
}
}

win32 {
    message(----win32 configure----$$PWD)

    QMAKE_CXXFLAGS += -source-charset:utf-8
    QMAKE_CXXFLAGS += -execution-charset:utf-8
    QMAKE_CXXFLAGS += -MP

    QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
    QMAKE_LFLAGS_RELEASE   = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
}

macx {
    message(----macx configure----$$PWD)
    DESTDIR  = $$PWD/../Bin/Bin-mac/LaserMaker.app/Contents/MacOS

    #CONFIG -= app_bundle

    # 生成带调试信息的
    QMAKE_CXXFLAGS += -g
    QMAKE_CXXFLAGS += -finput-charset=UTF-8
    CONFIG         += utf8_sources
}
